package com.linys.scala.study.string

/**
  * Created by admin on 2019/10/14.
  */
object Test {
  var str01: String = "Hello,World!"
  var str02: String = "Hello,World!"
  val str03: String = "Hello,World!"
  val str04: String = "Hello,World!"

  def main(args: Array[String]) {
    val s: String  = "Hello,World"
    val buf = new StringBuilder;
    buf ++= "Hello,World"
    println( str01 == str02)
    println( str01 == str03)
    println( str03 == str04)
    println( str03 == s)
    println( buf == s)
    println( "buf is : " + buf.toString )
    var palindrome = "Hello,World!"
    println( str03 == palindrome)
    var len = palindrome.length()
    println( "String Length is : " + len )

    var floatVar = 12.456
    var intVar = 2000
    var stringVar = "菜鸟教程!"
    val fs = printf("浮点型变量为:" +
      "%f,整型变量为:%d,字符串为:" +
      "%s", floatVar, intVar, stringVar)
    println(fs)
    println(printf("哈哈哈哈%s..........\n", "oooo"))
    println(printf("My name is %s. I hava %d apples and %d eggs.\n","013",2,3))
    println("aaa")

  }

}
